<?php
function share_size($size) {
    if ($size < 1024) {
        return round($size, 2) . ' B';
    }
    if ($size < (1024 * 1024)) {
        return round($size / 1024, 2) . ' KB';
    }
    if ($size < (1024 * 1024 * 1024)) {
        return round($size / (1024 * 1024), 2) . ' MB';
    } 
    if ($size < (1024 * 1024 * 1024 * 1024)) {
        return round($size / (1024 * 1024 * 1024), 2) . ' GB';
    }
    else{
        return round($size / (1024 * 1024 * 1024 * 1024), 2) . ' TB';
    }
}
?>
<ul>
<?php foreach($users as $user) : ?>
    <li><?php echo $user->Smb.' - Online: '.$user->IsOnline.' - Fájlok: '.$user->NumFiles.' - Méret: '.share_size($user->FullSize) ?></li>
<?php endforeach; ?>
</ul>
